<?php 
$editorLoaded = false;

if(($_REQUEST['cat'] > 0) && ($editorLoaded == false))
{ 
	require('view/cat/list.php');
	$editorLoaded = true; 
}
if(($_REQUEST['grp'] > 0) && ($editorLoaded == false))
{ 
	require('view/group/list.php');
	$editorLoaded = true; 
}
if(($_REQUEST['attribute'] > 0) && ($shop->getCurrentAttribute()) && ($editorLoaded == false))
{ 
	if(($shop->CurrentAttribute->getId() > 0) && ($shop->CurrentAttribute->getPredefined() > 0))
	{ require('view/attribute/editor.php'); }
	else
	{ require('view/attribute/list.php'); }
	$editorLoaded = true; 
}
if(($_REQUEST['exe'] > 0) && ($editorLoaded == false))
{ 
	if($exe['id'] > 0)
	{ require('view/exe/editor.php'); }
	else
	{ require('view/exe/list.php'); }
	$editorLoaded = true; 
}


if(($_REQUEST['provider'] > 0) && ($editorLoaded == false))
{ 
	require('view/provider/editor.php'); 
	$editorLoaded = true; 
}

if(($_REQUEST['shipping'] > 0) && ($editorLoaded == false))
{ 
	if($_REQUEST['edit'] == 'rules')
	{ require('view/shipping/rules.php'); }
	else
	{ require('view/shipping/zones.php'); }
	$editorLoaded = true; 
}

if(($shopCom->getCurrentProductId() > 0) && ($editorLoaded == false))
{ 
	require('view/product/editor.php');
	$editorLoaded = true;
}

if(($_REQUEST['list'] != '') && ($editorLoaded == false))
{
	switch($_REQUEST['list'])
	{
		case 'cat':
			require('view/cat/list.php');
			$editorLoaded = true;
			break;
		case 'grp':
			require('view/group/list.php');
			$editorLoaded = true;
			break;
		case 'attributes':
			require('view/attribute/list.php');
			$editorLoaded = true;
			break;
		case 'exe':
			if($exe['id'] > 0)
			{ require('view/exe/editor.php'); }
			else
			{ require('view/exe/list.php'); }
			$editorLoaded = true;
			break;
		case 'provider':
			require('view/provider/list.php');
			$editorLoaded = true;
			break;
		case 'brand':
			require('view/brand/list.php');
			$editorLoaded = true;
			break;
		case 'shipping':
			require('view/shipping/list.php');
			$editorLoaded = true;
			break;
		case 'orders':
			require('view/order/list.php');
			$editorLoaded = true;
			break;
		case 'report':
			require('view/report/list.php');
			$editorLoaded = true;
			break;
	}
}

if(($_REQUEST['m'] > 0) && ($editorLoaded == false))
{ 
	require('view/product/list.php'); 
	$editorLoaded = true;
}
/*
if($editorLoaded == false)
{ 
	//require('view/orders/list.php');
	//require('view/product/list.php');
	//require('view/shop/editor.php'); 
}
*/
?>